package com.yunxi.service.localService.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yunxi.dao.order.OrderApproveCustomerMapper;
import com.yunxi.model.order.OrderAutit;
import com.yunxi.order.pojo.*;
import com.yunxi.service.localService.OrderApproveCustomerService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service(value = "orderApproveCustomerServiceImpl")
public class OrderApproveCustomerServiceImpl extends ServiceImpl<OrderApproveCustomerMapper, OrderAutit> implements OrderApproveCustomerService {
    /**
     * 主机厂订单审批申请主数据查询
     * @param vo
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @Override
    @Transactional
    public PageInfo<OrderApproveRespVO> queryOrderApproveInfoForPage(OrderApproveReqVO vo, int pageIndex, int pageSize){
        PageHelper.startPage(pageIndex,pageSize);
        List<OrderApproveRespVO> resp = this.baseMapper.queryOrderApproveForPage(vo);
        PageInfo<OrderApproveRespVO> pageInfo = new PageInfo<>(resp);
        return pageInfo;
    }

    /**
     * 主机厂取消订单审核主数据查询
     * @param vo
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @Override
    @Transactional
    public PageInfo<OrderApproveCancelRespVO> queryCancelOrderApproveForPage(OrderApproveCancelReqVO vo, int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        List<OrderApproveCancelRespVO> resp = this.baseMapper.queryCancelOrderApproveForPage(vo);
        PageInfo<OrderApproveCancelRespVO> pageInfo = new PageInfo<>(resp);
        return pageInfo;
    }

    @Override
    @Transactional
    public OrderApprovePartnerDetailsRespVO queryPartnerDetails(OrderApproveDetailsReqVO vo) {
        return this.baseMapper.queryPartnerDetails(vo);
    }

    @Override
    @Transactional
    public OrderApproveCarDetailsRespVO queryCarDetails(OrderApproveDetailsReqVO vo) {
        return this.baseMapper.queryCarDetails(vo);
    }

    @Override
    @Transactional
    public OrderApproveVehicleDetailsRespVO queryOrderDetails(OrderApproveDetailsReqVO vo) {
        return this.baseMapper.queryOrderDetails(vo);
    }

    @Override
    @Transactional
    public List<OrderApproveCustomPackDetailsRespVO> queryCustomPackDetails(OrderApproveDetailsReqVO vo) {
        return this.baseMapper.queryCustomPackDetails(vo);
    }
}
